package com.zyp.demo.dao;

import com.zyp.demo.po.Type;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TypesRepository extends JpaRepository<Type,Long> {
    Type findByName(String name);

    @Query("select t from  Type  t")
    List<Type> findTop(Pageable pageable);/*按照倒叙的方式寻找前六条数据*/
}
